// 增强Array方法

function arrayIndexOf(arr, val) {
  for (let i = 0; i < arr.length; i++) {
    if (arr[i] === val) return i
  }
  return -1
}

function removeValueFromArray(arr, val) {
  const index = arrayIndexOf(arr, val)
  if (index > -1) {
    arr.splice(index, 1)
  }
}
export default {
  arrayIndexOf: arrayIndexOf,
  removeValueFromArray: removeValueFromArray
}
